package org.smart4j.chapter1.service;

import org.smart4j.chapter1.model.Customer;
import org.smart4j.chapter1.util.DatabaseHelper;

import java.sql.Connection;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

/**
 * Created by wangzhen on 2018/3/25.
 *
 * 提供客户数据服务
 */
public class CustomerService {

    /**
     * 获取客户列表
     *
     * @return
     */
    public List<Customer> getCustomerList(String sql) {
        List<Customer> customerList = DatabaseHelper.queryEntityList(Customer.class, sql);
        return customerList;
    }


    /**
     * 根据客户id 获取客户信息
     *
     * @param id
     * @return
     */
    public Customer getCustomer(Long id) {

        return null ;
    }

    /**
     * 创建用户
     *
     * @param fieldMap
     * @return
     */
    public boolean createCustomer(Map<String, Object> fieldMap) {
        return false ;
    }

    /**
     * 更新用户
     *
     * @param id
     * @param fieldMap
     * @return
     */
    public boolean updateCustomer(Long id, Map<String, Object> fieldMap) {
        return false ;
    }

    /**
     * 删除用户
     *
     * @param id
     * @return
     */
    public boolean deleteCustomer(Long id) {
        return false ;
    }
}
